package com.pet.controller.webUser;

import com.pet.dto.web.institution.PetInstitutionApplicationDTO;
import com.pet.result.Result;
import com.pet.service.PetInstitutionService;
import com.pet.vo.web.PetInformationVO;
import com.pet.vo.web.institution.PetInstitutionApplicationVO;
import com.pet.vo.web.institution.PetInstitutionInformationVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 基地与机构
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class PetInstitutionController {

    @Autowired
    private PetInstitutionService petInstitutionService;

    //用户与机构
    /**
     * 查询机构信息
     */
    @GetMapping("/petInstitution")
    private Result<List<PetInstitutionInformationVO>> selectPetInstitutionInformation(){

        return Result.success(petInstitutionService.selectPetInstitutionInformation());
    }

    /**
     * 查询机构动物信息
     */
    @GetMapping("/institutionPetInformation")
    private Result<List<PetInformationVO>> selectPetInformationAnimal(@RequestParam Integer id){
        return Result.success(petInstitutionService.selectPetInformationAnimal(id));
    }

    /**
     * 申请机构
     */
    @PostMapping("/applyInstitution")
    public Result applyInstitution(@RequestBody PetInstitutionApplicationDTO dto){
        log.info("申请机构");
        petInstitutionService.applyInstitution(dto);
        return Result.success();
    }

    /**
     * 查询机构申请进度
     */
    @GetMapping("/applyInstitution")
    public Result<PetInstitutionApplicationVO> selectApplicationStatus(){
        log.info("查询机构申请进度");

        return Result.success(petInstitutionService.selectApplicationStatus());
    }

    /**
     * 取消机构
     */
    @DeleteMapping("/applyInstitution")
    public Result deleteApplyInstitution(){
        log.info("取消机构");
        petInstitutionService.deleteApplyInstitution();
        return Result.success();
    }

    /**
     * 云养宠物
     */

    /**
     * 添加宠物进入基地
     */

    //机构空间相关
    /**
     * 设置机构图片
     */

    /**
     * 查看机构帖子
     */

    /**
     * 发布机构帖子
     */

    /**
     * 修改机构帖子
     */

    /**
     * 删除机构帖子
     */

}
